package com.sdkj.service.customer;

import java.util.List;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.sdkj.dao.DaoSupport;
import com.sdkj.entity.Page;
import com.sdkj.util.PageData;
@Service("customerService")
public class CustomerService {

	@Resource(name = "daoSupport")
	private DaoSupport dao;
	
	/*
	* 新增
	*/
	public void save(PageData pd)throws Exception{
		dao.save("CustomerMapper.save", pd);
	}
	
	/*
	* 新增
	*/
	public void saveUser(PageData pd)throws Exception{
		dao.save("CustomerMapper.saveUser", pd);
	}
	/*
	* 删除
	*/
	public void delete(PageData pd)throws Exception{
		dao.delete("CustomerMapper.delete", pd);
	}
	/*
	* 修改用户
	*/
	public void edit(PageData pd)throws Exception{
		dao.update("CustomerMapper.edit", pd);
	}
	/*
	* 批量删除用户
	*/
	public void deleteAll(String[] ArrayUSER_IDS)throws Exception{
		dao.delete("CustomerMapper.deleteAll", ArrayUSER_IDS);
	}
	/*
	* 通过loginname获取数据
	*/
	public PageData findById(PageData pd)throws Exception{
		return (PageData)dao.findForObject("CustomerMapper.findById", pd);
	}
	/*
	*列表(全部)11
	*/
	public List<PageData> listAll(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("CustomerMapper.listAll", pd);
	}
	/*
	*用户列表(用户组)
	*/
	public List<PageData> listPdPageCustomer(Page page)throws Exception{
		return (List<PageData>) dao.findForList("CustomerMapper.customerlistPage", page);
	}
	
}
